package com.lib.net

import com.lib.base.data.http.ApiException
import io.reactivex.Observable
import io.reactivex.functions.Function

class HttpErrorFunc<T> : Function<Throwable, Observable<T>> {

    @Throws(ApiException::class)
    override fun apply(throwable: Throwable): Observable<T> {
        return Observable.error(ApiExceptionService.handleException(throwable))
    }

}